import React from 'react'
import { useSearchParams } from 'react-router-dom'

export default function Search() {
    const [query, setQuery] = useSearchParams()
    console.log('query',query)

    console.log('id: ', query.get('id'));
    console.log('title:' , query.get('title'));

    let id = query.get('id');
    let title = query.get('title');
    return (
        <div>
            <h4>query参数</h4>
            <p>id: {id}</p>
            <p>title: {title}</p>
            <p><button onClick={()=>{
                setQuery('id=33&title=66666666');
            }}>手动设置query</button></p>
        </div>
    )
}
